package com.runshu.newsmartark.mvp.presenter;

import com.runshu.newsmartark.mvp.contract.SearchDtaContract;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.MyCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/11/4
 * @decs：
 */

public class SearchDtaPresenter implements SearchDtaContract.Presenter {
    private SearchDtaContract.View view;
    private SearchDtaContract.Model model;

    public SearchDtaPresenter(SearchDtaContract.View view, SearchDtaContract.Model model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void getSearchTitle(String proName, String mac) {

        model.getSearchTitle(proName, mac, new MyCallBack() {
            @Override
            public void onSuccess(ResponseBean data) {
                view.onGetSearchTitleSuccess(data);
            }

            @Override
            public void onError(ResponseBean data) {
                view.onError(data.getMessage());
            }
        });

    }
}